<?php

namespace App\Events\OpenShop;

use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

class SystemNotifyCenterEvent
{
    use Dispatchable, InteractsWithSockets, SerializesModels;

    public Model $notifyCenterModel;
    public array $prePushTargetList;


    public function __construct(Model $systemNotifyModel, array $prePushTargetList = [])
    {
        $this->notifyCenterModel = $systemNotifyModel;
        $this->prePushTargetList = $prePushTargetList;
    }

    /**
     * Get the channels the event should broadcast on.
     *
     * @return \Illuminate\Broadcasting\Channel|array
     */
    public function broadcastOn()
    {
        return new PrivateChannel('channel-name');
    }
}
